package com.legleg.conf;

import org.apache.commons.lang.StringUtils;
import org.apache.commons.lang.math.NumberUtils;

/**
 * Created by IntelliJ IDEA.
 * User: Sufeng
 * Date: 12-4-14
 * Time: 上午3:29
 * To change this template use File | Settings | File Templates.
 */
public class Configure {
    /*db config*/
    public static String DB_CLASS = LegProperty.getProperty("DB_CLASS");
    public static String DB_URL = LegProperty.getProperty("DB_URL");
    public static String DB_USERNAME = LegProperty.getProperty("DB_USERNAME");
    public static String DB_PASSWORD = LegProperty.getProperty("DB_PASSWORD");
    public static int DB_POOL_MAXCONS = NumberUtils.toInt(LegProperty.getProperty("DB_POOL_MAXCONS"), 20);
    public static int DB_POOL_MINCONS = NumberUtils.toInt(LegProperty.getProperty("DB_POOL_MINCONS"), 5);
    public static int DB_POOL_PARTITION_COUNT = NumberUtils.toInt(LegProperty.getProperty("DB_POOL_PARTITION_COUNT"), 1);

    /*memcached configure*/
    public static int MEMCACHED_STATUS_CHECK_INTERVAL = NumberUtils.toInt(LegProperty.getProperty("MEMCACHED_STATUS_CHECK_INTERVAL"), 60);
    public static String AX_MEMCACHED_SERVERS = StringUtils.defaultIfEmpty(LegProperty.getProperty("AX_MEMCACHED_SERVERS"), "127.0.0.1:11211");
    public static String AX_MEMCACHED_SERVERS_WEIGHTS = StringUtils.defaultIfEmpty(LegProperty.getProperty("AX_MEMCACHED_SERVERS_WEIGHTS"), "1");
    
    public static int LIVECOURSE_TIME = NumberUtils.toInt(LegProperty.getProperty("LIVE_COURSE_TIME"));
    public static int EXPERTCOURSE_TIME = NumberUtils.toInt(LegProperty.getProperty("EXPERT_COURSE_TIME"));
    public static String COURSE_SERVICE =LegProperty.getProperty("COURSE_SERVICE_NAME");

    public static String ALBUM_IMAGE_DIR =LegProperty.getProperty("ALBUM_IMAGE_DIR");
    public static String ALBUM_IMAGE_PATH =LegProperty.getProperty("ALBUM_IMAGE_PATH");

}
